1480 LOCATE 20,21:PRINT "File Size is ";SIZE;" bytes,";SECTORS;" sectors."
1490 CLUSTER = PEEK(I+&HD01A)+PEEK(I+&HD01B)*256
1500 LOCATE 21,21:PRINT "Starting Cluster is ";CLUSTER
1510 GOSUB 1600
1520 IF FLAG$="yes" THEN 1530 ELSE PRINT "There are sectors allocated after cluster ";CLUSTER;"!! Press return.";:INPUT IANS:GOTO 1580
1530 LOCATE 15,25:INPUT "Do you want to undelete this file?";IANS$
1540 IF LEFT$(IANS$,1)<>"Y" AND LEFT$(IANS$,1)<>"y" THEN 1580
1550 LOCATE 16,23:INPUT "Enter first letter for filename";IANS$
1560 LETTER1=ASC(IANS$)
1562 IF LETTER1<123 AND LETTER1>96 THEN LETTER1=LETTER1-31
1565 IF LETTER1<65 OR LETTER1>90 THEN 1530
1570 GOSUB 1680
1580 LOCATE 15,25:PRINT STRING$(53,32)
1590 LOCATE 16,25:PRINT STRING$(53,32):RETURN
1595 REM
1600 REM Cluster's Last Stand(checks clusters)
1601 REM
1602 REM This is the routine that checks the needed number of sectors
1603 REM immediatly following the first sector of the file being
1604 REM undeleted! FLAG$ contains the indicator as to the outcome
1605 REM of the check.
1606 REM
1608 IF NOSIDES=1 THEN RANGE=SECTORS ELSE RANGE=INT((SECTORS+1)/2)
1610 FOR INC=1 TO RANGE
1620 TEMP=INT((CLUSTER+INC-1)*1.5)
1630 IF CLUSTER MOD 2 = 1 THEN NEWCLUS=((PEEK(&HCC00+TEMP) AND 240)/16)+PEEK(&HCC00+TEMP+1)*256 ELSE NEWCLUS=PEEK(&HCC00+TEMP)+((PEEK(&HCC00+TEMP+1) AND 15)*256)
1640 IF NEWCLUS<>0 THEN FLAG$="no":GOTO 1670
1650 NEXT INC
1660 FLAG$="yes"
1670 RETURN
1675 REM
1680 REM Cluster's Last Stand(updates clusters)
1681 REM
1682 REM This routine reallocates the sectors following the first sector.
1683 REM Appendix C of the DOS Manual gives the technique for accessing
1684 REM this information.
1685 REM
1688 IF NOSIDES=1 THEN RANGE=SECTORS-1 ELSE RANGE=INT((SECTORS+1)/2)-1
1690 FOR INC=1 TO RANGE
1700 TEMP=INT((CLUSTER+INC-1)*1.5)
1710 IF (CLUSTER+INC-1) MOD 2 = 1 THEN BYTE1=(PEEK(&HCC00+TEMP) AND 15) + (((CLUSTER + INC) AND 15)*16):BYTE2=INT((CLUSTER+INC)/16):GOTO 1730
1720 BYTE1=(CLUSTER+INC) AND 255:BYTE2=(PEEK(&HCC00+TEMP+1) AND 240) + INT((CLUSTER+INC)/256)